package cn.lucky.springcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author lingpeng.jiang
 * @create 2020-12-14-22:59
 */
@RestController
@RequestMapping("/consumer")
public class OrderConsulController {

    @Autowired
    private RestTemplate restTemplate;

    public static final String PAYMENT_CONSUL_URL = "http://cloud-consul-provider-payment";

    @GetMapping("/payment/consul")
    public String orderConsul(){
        return restTemplate.getForObject(PAYMENT_CONSUL_URL + "/payment/consul",String.class);
    }

}
